import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login'

Vue.use(VueRouter)

  // 获取原型对象上的push函数
  const originalPush = VueRouter.prototype.push
  // 修改原型对象中的push方法
  VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
  }
  
  const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  // 任务管理
  {
    path: '/ManageList',
    name: 'ManageList',
    component: () => import('../views/taskManage/manageList.vue'),
  },
  // 任务列表
  {
    path: '/TaskList',
    name: 'TaskList',
    component: () => import('../views/taskManage/taskList.vue'),
  },
  // 任务详情
  {
    path: '/TaskDetails',
    name: 'TaskDetails',
    component: () => import('../views/taskManage/taskDetails.vue'),
  },
  // 线索管理
  // 线索管理-管理员
  {
    path: '/ClueManageList',
    name: 'ClueManageList',
    component: () => import('../views/clueManage/clueManageList.vue')
  },
  // 线索结果列表
  {
    path: '/ClueResultList',
    name: 'ClueResultList',
    component: () => import('../views/clueManage/clueResultList.vue')
  },
  // 线索集列表
  {
    path: '/CluesList',
    name: 'CluesList',
    component: () => import('../views/clueManage/cluesList.vue')
  },
  // 线索集
  {
    path: '/CluesDetails',
    name: 'CluesDetails',
    component: () => import('../views/clueManage/cluesDetails.vue')
  },
  // 线索管理-检察官个人
  {
    path: '/ClueMangeInquisitor',
    name: 'ClueMangeInquisitor',
    component: () => import('../views/clueMangeInquisitor/clueMangeInquisitor.vue')
  },
  // 推荐线索总览
  {
    path: '/PushClueOverview',
    name: 'PushClueOverview',
    component: () => import('../views/clueMangeInquisitor/pushClueOverview.vue')
  },
  // 线索集
  {
    path: '/clueSet',
    name: 'clueSet',
    component: () => import('../views/clueMangeInquisitor/clueSet.vue')
  },
  // 线索跟踪
  {
    path: '/ClueTrack',
    name: 'ClueTrack',
    component: () => import('../views/clueTrack.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
